package com.six.order.controller;


;
import com.six.core.vo.Result;


import com.six.order.service.impl.PayServiceImpl;
import com.six.order.vo.PayInfoVo;
import com.six.order.vo.dto.PayResultDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * ClassName:AlipayController
 * Description:
 * date:2023/3/4 10:52
 *
 * @since JDK 1.8
 */
@Api(value = "/order/pay", tags = {"ClassName:AlipayController Description: date:2023/3/4 10:52"})
@RestController
@RequestMapping("/order/pay")
//@CrossOrigin
public class AlipayController {

    @Autowired
    private PayServiceImpl payService;

    @ApiOperation("返回支付二维码和支付信息")
    @GetMapping("/qr/{orderId}")
    public Result getPayInfo(@PathVariable String orderId) {
        PayInfoVo payInfoVO = payService.getPayInfo(orderId);
        return new Result(2000,"二维码生成",payInfoVO);
    }

    @ApiOperation("获取支付状态")
    @GetMapping("/status/{orderId}")
    public Result getPayStatus(@PathVariable String orderId){
        PayResultDTO payStatus = payService.getPayStatus(orderId);
        return new Result(2000,"支付状态对象",payStatus);
    }





}